package com.itheima.web;


import com.itheima.pojo.Brand;
import com.itheima.pojo.User;
import com.itheima.service.BrandService;
import com.itheima.service.UserService;
import com.itheima.service.UserServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = Test2.class)
public class MyTest {

    @Autowired
    public BrandService brandService;

    @Autowired
    public UserService userService;


    @Test
    public void Test1(){

        ApplicationContext context = new AnnotationConfigApplicationContext(Test2.class);
        List<Brand> brands = brandService.selectAll();
        System.out.println(brands);



    }


    @Test
    public void Test2(){
        ApplicationContext context = new AnnotationConfigApplicationContext(Test2.class);
        User wbk = userService.select("zhangsan", "121");

        System.out.println(wbk);


    }


}
